package net.thxjj.sitermodel;

import java.util.List;

/**
 * 系统用户
 * @author rstyro
 *
 */
public class User {
	private Long user_id;
	private String username;
	private String nickname;
	private String password;
	private String avatar;
	private Long status;
	private String sessionId;
	private String token;
	private Long token_time;
	private Long create_time;
	private String phone;
	private Long sex;
	private String email;
	private Long age;
	private String pid;
	private List<String> permissionCodes;

	public String getSessionId() {
		return sessionId;
	}
	public void setSessionId(String sessionId) {
		this.sessionId = sessionId;
	}

	private UserRole userRole;

	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public Long getUser_id() {
		return user_id;
	}

	public void setUser_id(Long user_id) {
		this.user_id = user_id;
	}

	public Long getToken_time() {
		return token_time;
	}

	public void setToken_time(Long token_time) {
		this.token_time = token_time;
	}

	public Long getCreate_time() {
		return create_time;
	}

	public void setCreate_time(Long create_time) {
		this.create_time = create_time;
	}

	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Long getSex() {
		return sex;
	}

	public void setSex(Long sex) {
		this.sex = sex;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Long getAge() {
		return age;
	}

	public void setAge(Long age) {
		this.age = age;
	}

	public Long getStatus() {
		return status;
	}
	public void setStatus(Long status) {
		this.status = status;
	}
	public UserRole getUserRole() {
		return userRole;
	}
	public void setUserRole(UserRole userRole) {
		this.userRole = userRole;
	}

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}


	public List<String> getPermissionCodes() {
		return permissionCodes;
	}

	public void setPermissionCodes(List<String> permissionCodes) {
		this.permissionCodes = permissionCodes;
	}

	public User() {
		super();
	}
	public User(Long user_id, String username, String nickname, String password, String avatar) {
		super();
		this.user_id = user_id;
		this.username = username;
		this.nickname = nickname;
		this.password = password;
		this.avatar = avatar;
	}
	
	
	public User(Long user_id, String username, String nickname, String password, String avatar, UserRole userRole) {
		super();
		this.user_id = user_id;
		this.username = username;
		this.nickname = nickname;
		this.password = password;
		this.avatar = avatar;
		this.userRole = userRole;
	}
	public User(Long user_id, String username, String nickname,
			String password, String avatar, Long status, String sessionId,
			UserRole userRole) {
		super();
		this.user_id = user_id;
		this.username = username;
		this.nickname = nickname;
		this.password = password;
		this.avatar = avatar;
		this.status = status;
		this.sessionId = sessionId;
		this.userRole = userRole;
	}

	@Override
	public String toString() {
		return "User{" +
				"user_id=" + user_id +
				", username='" + username + '\'' +
				", nickname='" + nickname + '\'' +
				", password='" + password + '\'' +
				", avatar='" + avatar + '\'' +
				", status=" + status +
				", sessionId='" + sessionId + '\'' +
				", token='" + token + '\'' +
				", token_time=" + token_time +
				", create_time=" + create_time +
				", phone='" + phone + '\'' +
				", sex=" + sex +
				", email='" + email + '\'' +
				", age=" + age +
				", pid='" + pid + '\'' +
				", permissionCodes='" + (permissionCodes==null?"":permissionCodes.toString()) + '\'' +
				", userRole=" + (userRole==null?"":userRole.toString())  +
				'}';
	}
}
